class ENEMY : public AI {
    public:
        ENEMY();
        ~ENEMY();
        
        int ai;
        bool alive;
        
        void Update();
        bool Spawn(IMAGE * image, int &x, int &y);
    
    private:
}zombie[100], greenEnemy[100], yellowEnemy[100];

void ENEMY::Update()
{
    //draw image
    if(!image){oslWarning("ERROR! NO IMAGE equippedin ENEMY Update function! EXITING function!"); return;}
    else oslDrawImage(image); 
    
    //gravity
    image->y+=sy;
    if(image->y > (GROUND - image->stretchY)) image->y = (GROUND - image->stretchY);
    if(image->y != (GROUND - image->stretchY)) sy++;
    
    /* keep within the screen */
    if(image->x > (480 - image->stretchX))
      {image->x = (479 - image->stretchX);}
    if(image->x <= 0)
      {image->x = 1;}
      
    if(ai == ZOMBIE) Drift(image, facing, ai);
    
    //adjust image
    if(facing == FACING_LEFT) position = ENEMY_LEFT;
    if(facing == FACING_RIGHT) position = ENEMY_RIGHT;
    
    //check for death
    if(health <= 0) alive = false;
    
    SpriteAnimate();
    
    return;
}

bool ENEMY::Spawn(IMAGE * image, int &x, int &y)
{
    int randomX = 240;
    int randomY = 100;
    
    srand((unsigned)time(0));
    randomX = (rand()%470)+10;
    randomY = (rand()%150)+(GROUND - image->stretchY);
    
    x = randomX;
    y = randomY;
        
    return true;
}

ENEMY::ENEMY()
{
    health = 1;
    attack = 1;
    facing = FACING_RIGHT;
    alive = false;
    
    return;
}

ENEMY::~ENEMY()
{
    return;
}
